/*
 * @Author: biankai
 * @Date: 2021-04-19 18:47:04
 * @LastEditTime: 2021-11-09 10:22:31
 * @LastEditors: biankai
 * @FilePath: /gitee/devops_service/src/app.module.ts
 */
import { Module, HttpModule } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { APP_INTERCEPTOR } from '@nestjs/core';
import { ErrorsInterceptor } from './common/error.interceptor';
import { NamespaceModule } from './modules/kubernetes/namespace.module';
import { DeploymentModule } from './modules/kubernetes/deployment.module';
import { ServiceModule } from './modules/kubernetes/service.module';

import { JobModule } from './modules/jenkins/job.module';
import { BuildModule } from './modules/jenkins/build.module';
import { ViewModule } from './modules/jenkins/view.module';

@Module({
  imports: [
    NamespaceModule,
    DeploymentModule,
    ServiceModule,

    JobModule,
    BuildModule,
    ViewModule,

    HttpModule.register({
      timeout: 5000,
      maxRedirects: 5,
    }),
  ],
  controllers: [AppController],
  providers: [
    {
      provide: APP_INTERCEPTOR,
      useClass: ErrorsInterceptor,
    },
    AppService,
  ],
})
export class AppModule { }
